<template>
  <div>
    首页
    <!-- 自定义指令loading -->
    <div v-loading="loading" class="box" />
    <el-button @click="loading=true">点击显示loadin</el-button>
    <!-- 按钮loading -->
    <el-button :loading="loading">点击显示loadin</el-button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      loading: false
    }
  },
  created() {
    const obj = {
      add: '新增',
      edit: '编辑'
    }
    const mode = 'add'
  }
}
</script>
<style lang="scss" scoped>
.box{
  width: 300px;
  height: 300px;
  background-color: #f00;
}
</style>
